package com.ruoyi.boss.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.boss.mapper.TThresholdMapper;
import com.ruoyi.boss.domain.TThreshold;
import com.ruoyi.boss.service.ITThresholdService;

/**
 * 时间阈值Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-18
 */
@Service
public class TThresholdServiceImpl implements ITThresholdService 
{
    @Autowired
    private TThresholdMapper tThresholdMapper;

    /**
     * 查询时间阈值
     * 
     * @param thresholdId 时间阈值主键
     * @return 时间阈值
     */
    @Override
    public TThreshold selectTThresholdByThresholdId(Long thresholdId)
    {
        return tThresholdMapper.selectTThresholdByThresholdId(thresholdId);
    }

    /**
     * 查询时间阈值列表
     * 
     * @param tThreshold 时间阈值
     * @return 时间阈值
     */
    @Override
    public List<TThreshold> selectTThresholdList(TThreshold tThreshold)
    {
        return tThresholdMapper.selectTThresholdList(tThreshold);
    }

    /**
     * 新增时间阈值
     * 
     * @param tThreshold 时间阈值
     * @return 结果
     */
    @Override
    public int insertTThreshold(TThreshold tThreshold)
    {
        tThreshold.setCreateTime(DateUtils.getNowDate());
        return tThresholdMapper.insertTThreshold(tThreshold);
    }

    /**
     * 修改时间阈值
     * 
     * @param tThreshold 时间阈值
     * @return 结果
     */
    @Override
    public int updateTThreshold(TThreshold tThreshold)
    {
        tThreshold.setUpdateTime(DateUtils.getNowDate());
        return tThresholdMapper.updateTThreshold(tThreshold);
    }

    /**
     * 批量删除时间阈值
     * 
     * @param thresholdIds 需要删除的时间阈值主键
     * @return 结果
     */
    @Override
    public int deleteTThresholdByThresholdIds(Long[] thresholdIds)
    {
        return tThresholdMapper.deleteTThresholdByThresholdIds(thresholdIds);
    }

    /**
     * 删除时间阈值信息
     * 
     * @param thresholdId 时间阈值主键
     * @return 结果
     */
    @Override
    public int deleteTThresholdByThresholdId(Long thresholdId)
    {
        return tThresholdMapper.deleteTThresholdByThresholdId(thresholdId);
    }
}
